#include "SelfDebug.h"
#include "implementation/SelfDebug.h"

#include <pthread.h>

namespace sd {
SelfDebug &SelfDebug::getInstance() {
	static SelfDebug *pointer = NULL;
	if (pointer == NULL) {
		static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
		pthread_mutex_lock(&mutex);
		if (pointer == NULL) {
			static implementation::SelfDebug instance;
			pointer = &instance;
		}
		pthread_mutex_unlock(&mutex);
	}
	return *pointer;
}

SelfDebug::SelfDebug()
		: flattenMultidimensionalArray_(false) {
}

SelfDebug::~SelfDebug() {
}

void SelfDebug::setFlattenMultidimensionalArray(bool _flattenMultidimensionalArray) {
	flattenMultidimensionalArray_ = _flattenMultidimensionalArray;
}

}
